package com.hb.resource.job;

import com.hb.resource.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 * @author hb
 * @date 2023/4/22
 * 获取股票数据源定时任务
 */

@Component
public class GuPiaoJob {

    @Autowired
    @Qualifier("guPiaoService")
    private BusinessService businessService;

    @Value("${data.resource.gupiao-url:}")
    private String url;

    //@Scheduled
    public void process() throws IOException, ExecutionException, InterruptedException {
        businessService.process(url, "GET");
    }
}
